import {createBrowserRouter} from 'react-router-dom'
import { lazy } from 'react'
import App from '../App'

const Data=lazy(()=>import('@/page/data/Index'))
const Data1=lazy(()=>import('@/page/data1/Index'))

type routesType={
    path:string,
    element:JSX.Element,
    children?:{path:string,element:JSX.Element,}[]
}[]

const routes:routesType=[
    {
        path:'/',
        element:<App />,
        children:[
            {
                path:'/data',
                element:<Data />
            },
            {
                path:'/data1',
                element:<Data1 />
            },
        ]
    }
]

const router=createBrowserRouter(routes)

export default router